
<!--
/**************************************************
* @ historyorderquery.jsp
*
* Copyright   2005 Hitrust Technology Inc.
* Developed by SDC, Hitrust.
* All Rights Reserved.
*
* Modify History:
*  v1.00, 2006/02/16, Jenny Li
*  1) first release
/**************************************************
-->
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>
<%@page import="system.LoginContext"%>
<%@page import="framework.core.SrvContext"%>
<html>
<head>
<title>历史采购单查询</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<!--<LINK href="<%=root%>/css/css.css" type=text/css rel=stylesheet>-->
<LINK href="<%=root%>/css/caigouxitong.css"" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language=javascript src="<%=root%>/framework/js/datePicker/WdatePicker.js"></SCRIPT>
<%
ArrayList ary = (ArrayList)request.getAttribute("orderdept");
	ResultProcess tOrder = (ResultProcess)request.getAttribute("order");
	ArrayList tList = new ArrayList();
	String [] tStr = null;
%>
<script>
	var counter;
	function process(val){
		if(val == 'Q'){
			var tStr = "";		
			var tEnd = "";				
			if(!isEmpty(orderqueryform.orderCreateDateStr.value)){
				tStr = orderqueryform.orderCreateDateStr.value.substr(0,4) + orderqueryform.orderCreateDateStr.value.substr(5,2) + orderqueryform.orderCreateDateStr.value.substr(8,2);
			}
			if(!isEmpty(orderqueryform.orderCreateDateEnd.value)){
				tEnd = orderqueryform.orderCreateDateEnd.value.substr(0,4) + orderqueryform.orderCreateDateEnd.value.substr(5,2) + orderqueryform.orderCreateDateEnd.value.substr(8,2);						
			}
			if(parseInt(tStr) > parseInt(tEnd)){
					alert("申购单创建周期的开始日期不能大于截止日期！");
					return false;
			}		
			orderqueryform.action = "<%=response.encodeURL(request.getContextPath()+"/A220302.do")%>" ;
    		orderqueryform.submit();			
		}else if(val == 'C'){
			orderqueryform.orderId.value ="";
			orderqueryform.orderDetailId.value="";
			orderqueryform.orderDeptId.selectedIndex=0;	
			orderqueryform.concentricityId.value = "";
			orderqueryform.manufInfo.value = "";
			orderqueryform.orderCreateDateStr.value = "";						
			orderqueryform.orderCreateDateEnd.value = "";
            orderqueryform.drawingpiececode.value = "";									
			return false;		
		}

	}		
</script>
</head>

<body text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name=orderqueryform method="get" >
<p><br></p>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td height="20">
			<table width="100%" border="0" cellspacing="0" cellpadding="1">
				<tr height="20">
					<td height="30" width="758" class="mtxt_black">历史采购信息查询
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td class="bg_line" height="2"></td>
	</tr>
</table>
<br>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center width="15%">申购单编号</TD>
					<TD align=left class="bg_row_odd" width="35%">
					<input type="text" name="orderId" value="<%=request.getParameter("orderId")==null? "":request.getParameter("orderId") %>" maxlength="20"></TD>					
					<TD class="bg_column" align="center">申购单明细编号</TD>
					<TD align="left" class="bg_row_odd">
						<input type="text" name="orderDetailId" value="<%=request.getParameter("orderDetailId")==null? "":request.getParameter("orderDetailId") %>" maxlength="20" >
					</TD>
				</TR>
				<TR height=20>							
					<TD class="bg_column" align=center>订货单位</TD>
					<TD left=right class="bg_row_odd" >
                    <%String warehouseCode=request.getParameter("orderDeptId")==null?"":request.getParameter("orderDeptId"); %>
						<select name="orderDeptId">
						<option value="<%=LoginContext.get(new SrvContext(request,response)).getLoginWarehouseCode() %>">---全部---</option>
                            <%
                              if(ary!=null&&ary.size()>0){
                                 for(int i=0;i<ary.size();i++){ 
                                     GSWareHouseBean tmp=(GSWareHouseBean)ary.get(i);%>
                                    <%if(tmp.getCode().equals(warehouseCode)){ %>
                                        <option value="<%=tmp.getCode() %>" selected><%=tmp.getName() %></option>
                                    <%}else{ %>
                                    <option value="<%=tmp.getCode() %>"><%=tmp.getName() %></option>
                            <%}}} %>  
						</select>
					</TD>
                    <TD class="bg_column" align=center>集中编码</TD>
                    <TD align=left class="bg_row_odd">
                    <input type="text" name="concentricityId" maxlength="20" value="<%=request.getParameter("concentricityId")==null?"":request.getParameter("concentricityId")%>">
                    </TD>				
				</TR>												
				<TR height=20>
					<TD class="bg_column" align=center>产品信息</TD>
					<TD align=left class="bg_row_odd" colspan="3">
					<input type="text" name="manufInfo" maxlength="200" value="<%=request.getParameter("manufInfo")==null?"":request.getParameter("manufInfo")%>">（<FONT color="#ff0033">对产品名称、型号、规格、品牌、生产厂商、附加属性等关键字的模糊查询</FONT>）&nbsp;
					</TD>
				</TR>									
				<TR height=20>	
					<TD class="bg_column" align=center>创建时间</TD>
					<TD align=left class="bg_row_odd">
					<%=framework.custom.UIManager.generateDateInput("orderCreateDateStr",
							request.getParameter("orderCreateDateStr")==null?"":request.getParameter("orderCreateDateStr"))%>
					
					至
					<%=framework.custom.UIManager.generateDateInput("orderCreateDateEnd",
							request.getParameter("orderCreateDateEnd")==null?"":request.getParameter("orderCreateDateEnd"))%>
					
					
					</TD>
                    <td class="bg_column" align=center>图件号</td>
                    <td align=left class="bg_row_odd" >
                    <input type="text" name="drawingpiececode" value="<%=request.getParameter("drawingpiececode")==null?"":request.getParameter("drawingpiececode") %>">
                    </td> 
				</TR>
            <%
            if(tOrder != null) {
                int totalRecords = 0;
                if(request.getAttribute("totalRecords")!=null){
                    totalRecords=Integer.parseInt((String)request.getAttribute("totalRecords"));
                }
                int defaultPageSize =10;
                if(request.getAttribute("pageSize")!=null){
                    defaultPageSize=Integer.parseInt((String)request.getAttribute("pageSize"));
                }
            %>          
            <page:pager total='<%=totalRecords%>' defaultPageSize='<%=defaultPageSize%>'></page:pager>
            <%} %>
			</table>
		</td>
	</tr>
</table>
</form>
    <p align="center">  
<!--		<input type="image" src="<%=root%>/images/button/chaxun.gif" width="58" height="24" class="box" onclick="process('Q')"/>&nbsp;-->
<!--		<input type="image" src="<%=root%>/images/button/clean.gif" width="58" height="24" class="box" onclick="process('C')"/>&nbsp;				-->
		<input type="button" name="查询" value="查询" class="kuang" onclick="process('Q')"/>&nbsp;
		<input type="button" name="清空" value="清空" class="kuang" onclick="process('C')"/>&nbsp;	
    </p>
<%
	
	if(tOrder != null){
%>
	<center>
    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>
            <form name='pager' method="post">
  
            	<table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
                    <tbody> 
                    <tr class="bg_column" height=20>
                        <td class=top align=middle colspan="14"> 
                        <div align="center" class="txt_content"><b>申购单信息列表</b>
                    	  </div>
						</td>					
					</tr> 
                    <tr class="bg_column" height=20> 
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">申购单明细编号</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">集中编码</div>
						</td>						
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">产品名称</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">规格</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">型号</div>
						</td>																																				
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">品牌</div>
						</td>
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">图件号</div>
                        </td>											
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">订货数量</div>
						</td>																	
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">创建时间</div>
						</td>										
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">订货单位</div>
						</td>										
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">价格（元）</div>
						</td>										
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">总价（元）</div>
						</td>																												
                        <td class=top align=middle> 
                        <div align="center" class="txt_content">详细信息</div>
						</td>																																				
					</tr>
					<%
						tList = tOrder.getAllRecoreds();
						if(tList != null && tList.size() > 0){
						for(int i=0; i<tList.size(); i++){
							tStr = (String[])tList.get(i);
							String tTempStr="";
							if(i%2==0){
								tTempStr="class=\"bg_row_odd\"";
							}else {
								tTempStr="class=\"bg_row_even\"";
							}
					%>
							<tr <%=tTempStr%> height=20>
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<%=tStr[0]%>
									</div>
								</td>	
								<td class=top align=middle> 								
									<div align="center" class="txt_content">
									<%=tStr[1]%>
									</div>
								</td>														
								<td class=top align=middle > 								
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root + "/A100404.do?&concentricityId="+tStr[1])%>" target="_blank"><%=tStr[2]%></a>
									</div>
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[3]%>
									</div>
								</td>				
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[4]%>
									</div>
								</td>	
                                <td class=top align=middle> 
                                    <div align="center" class="txt_content">
                                    <%=tStr[5]%>
                                    </div>
                                </td>												
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[13]%>
									</div>
								</td>						
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[6]%>
									</div>
								</td>								
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[7]%>
									</div>
								</td>															
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[8]%>
									</div>
								</td>																
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[9]%>
									</div>
								</td>	
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<%=tStr[10]%>
									</div>
								</td>															
								<td class=top align=middle> 
									<div align="center" class="txt_content">
									<a href="<%=response.encodeURL(root + "/A220303.do?orderId="+tStr[11])%>&orderDetailId=<%=tStr[0]%>" target="_blank">详细</a>
									</div>
								</td>																																								
							</tr> 
					<%
						}
					%>
						  <tr class="bg_column" height=20>
						    <td width="960" height="16" colspan="14" align="right">
									<!--导航条-->
						    		<page:navigator type='text' queryForm='orderqueryform'/>
						    </td>
						  </tr>					
				    <%
						}else{
					%>
                        <tr class="bg_column" height=20>
                            <td width="960" height="16" colspan="14" align="right">
                                    <font color="red">没有符合条件的历史采购信息</font>
                            </td>
                          </tr>
							
					<%
						}
					%>
					</tbody>
				</table>
				</form>					  
			</td>
		</tr>
	</table>
	</center>
<%		
	}
%>

</body>
</html>